/*
 * @Date: 2021-09-12 19:21:05
 * @Author: Acckno1
 * @LastEditTime: 2021-09-12 19:23:23
 * @Description: 
 */
#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
#include <unordered_map>

using namespace std;

const int N = 20;

int n, m, k, Q;
queue<int> q[N];
int sum[N];

int main() {
    cin >> n >> m >> k >> Q;
    
    unordered_map<int, int> mp;
    
    for (int i = 1; i <= k; i ++ ) {
        int s;
        cin >> s;
        
        int t = 0;
        for (int j = 0; j < n; j ++ ) 
            // 如果人数不够n * m 直接选择队伍最少的进行排队。
            if (i <= n * m) {
                if (q[j].size() < q[t].size()) t = j;
            } else {
                // 如果人数大于 n * m 选择队首时间最短的进行排队
                if (q[j].front() < q[t].front()) t = j;
            }
        
        // 队列时间加上入队的人
        sum[t] += s;
        if (i > n * m) q[t].pop();
        q[t].push(sum[t]);
        
        if (sum[t] - s < 540) mp[i] = sum[t];
    }
    
    while (Q -- ) {
        int idx;
        cin >> idx;
        if (mp.count(idx)) 
            printf("%02d:%02d\n", mp[idx] / 60 + 8, mp[idx] % 60);
        else 
            printf("Sorry\n");
    }
    return 0;
}